home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / utils / file / logiso.000 / logiso / Utils / RCS / search_cd,v < prev   
Encoding:
Text File  |  1995-03-24  |  1.6 KB  |  98 lines

  1. head    1.3;
  2. access;
  3. symbols
  4.     VER_0_3:1.3
  5.     VER_0_2:1.2;
  6. locks; strict;
  7. comment    @# @;
  8.  
  9.  
  10. 1.3
  11. date    95.03.24.11.43.35;    author coulter;    state Exp;
  12. branches;
  13. next    1.2;
  14.  
  15. 1.2
  16. date    95.02.19.16.06.41;    author coulter;    state Exp;
  17. branches;
  18. next    1.1;
  19.  
  20. 1.1
  21. date    95.02.18.08.36.38;    author coulter;    state Exp;
  22. branches;
  23. next    ;
  24.  
  25.  
  26. desc
  27. @search for a path to a directory
  28. @
  29.  
  30.  
  31. 1.3
  32. log
  33. @Checkin version for 0.3 distribution.
  34. @
  35. text
  36. @#! /bin/ksh
  37. USAGE='USAGE: search_cd cd_links
  38.    cd_links is a file with file_path 2 tabs and a link value.
  39.    listing all the link files on the CD and the link value.
  40.  
  41.    Find out how we can get to
  42.    /mnt/system_cd/usr/packages/interviews/bin
  43.    through a link.  Look for a link to a file below bin or to 
  44.    bin itself.
  45. '
  46. # (C) Copyright 1995 by Michael Coulter.  All rights reserved.
  47.  
  48. # SEARCH_DIR='/mnt/system_cd/usr/packages'
  49. #SEARCH_DIR='/mnt/system_cd/usr/lib/smail'
  50. #SEARCH_DIR='/mnt/system_cd/usr/X11R6/lib/X11'
  51. SEARCH_DIR='/system_cd/usr/lib/emacs'
  52.  
  53. # Process parameters
  54.  
  55.    CD_LINK="$1" ; shift
  56.  
  57. # Do it
  58.  
  59.   set -P # print absolut hw path
  60.   cat "$CD_LINK" | while read FILE LINK REST
  61.   do
  62.      # echo "search_cd: $FILE $LINK"
  63.      if [ -d "$FILE" ]
  64.      then
  65.         cd "$FILE"
  66.      else
  67.         cd $(dirname "$FILE")
  68.         cd $(dirname "$LINK") 2> /dev/null
  69.      fi
  70.      # echo "search_cd: dir is $PWD"
  71.      if [ "$PWD" != "${PWD#$SEARCH_DIR}" ]
  72.      then
  73.     echo "$FILE with link $LINK is a problem"
  74.      fi
  75.   done
  76.   exit 0
  77. @
  78.  
  79.  
  80. 1.2
  81. log
  82. @Checkpoint version 0.1
  83. @
  84. text
  85. @d11 1
  86. @
  87.  
  88.  
  89. 1.1
  90. log
  91. @Checkpoint version before fixing /usr/bin install
  92. @
  93. text
  94. @d12 4
  95. a15 1
  96. SEARCH_DIR='/mnt/system_cd/usr/packages'
  97. @
  98.